package cos.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JComboBox;
import javax.swing.JPanel;

import cos.utils.Preferences;

public class TranslationDirectionComboBox extends JPanel implements
		ActionListener {
	Preferences pref = Preferences.getInst();

	JComboBox patternList;

	public TranslationDirectionComboBox() {

		patternList = new JComboBox(pref.getTranslDirections().toArray());
		patternList.setEditable(false);
		patternList.addActionListener(this);
		add(patternList);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		pref.changeTranslateDirection(patternList.getSelectedItem().toString());
	}
}
